/*
 * EventCallback.h
 *
 *  Created on: Jun 17, 2010
 *      Author: Ry
 */

#ifndef EVENTCALLBACK_H_
#define EVENTCALLBACK_H_

#include "EventHandler.h"

template <class Target, class Event> class ClassCallback {
protected:
	void (Target::*callback)(Event, float);
	Target* target;

public:
	ClassCallback(Target* target, void (Target::*callback)(Event, float)) {
		this->target = target;
		this->callback = callback;
	}

	void handleEvent(Event event, float dts) {
		(target->*callback)(event, dts);
	}

	virtual ~ClassCallback(){};
};

#endif /* EVENTCALLBACK_H_ */
